<!DOCTYPE html>
<html lang="zh-cmn-Hans" prefix="og: http://ogp.me/ns#" class="han-init">
<head>
  <meta charset="utf-8">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <link rel="icon" href="http://upeng.github.io/favicon.ico">
  <title>upeng</title>
  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/lib/fancybox/jquery.fancybox-1.3.4.css">
  <!--在这里倒入jquery 方便处理部分页面的jquery-->
  <script src="https://cdn.staticfile.org/jquery/1.7/jquery.min.js" type="text/javascript" ></script>
</head>

<body>
	<header class="site-header navfixed-false">
  <div class="container">
      <h1><a href="/" title="upeng"><span class="octicon octicon-mark-github"></span> upeng</a></h1>
      <nav class="site-header-nav" role="navigation">
        
              
              <a href="/"  class=" site-header-nav-item hvr-underline-from-center" title="Home">Home</a>
        
              
              <a href="/categories/"  class=" site-header-nav-item hvr-underline-from-center" title="Categories">Categories</a>
        
              
              <a href="/bookmark/"  class=" site-header-nav-item hvr-underline-from-center" title="Bookmark">Bookmark</a>
        
              
              <a href="http://shareup.sinaapp.com"  class=" site-header-nav-item hvr-underline-from-center" title="Share">Share</a>
        
              
              <a href="/about/"  class=" site-header-nav-item hvr-underline-from-center" title="About">About</a>
        
      </nav>
  </div>
</header>

	
<section class="collection-head geopattern" data-pattern-id="Mac下的终端和命令行item2和zsh" >
    <div class="container">
        <div class="collection-title">
            <h1 class="collection-header">
                Mac下的终端和命令行item2和zsh
            </h1>
            
                <div class="collection-info">
                    <span class="meta-info">
                        <span class="octicon octicon-calendar"></span>
                        <time datetime="2016-12-04T13:34:48.000Z" itemprop="datePublished">2016-12-04</time>
                    </span>
                    
                        <span class="meta-info">
                            <span class="octicon octicon-file-directory"></span>
                            <a href='/categories/乱炖/' title=''>乱炖</a>
                        </span>
                    
                </div>
            
        </div>
    </div>
</section>
	<section class="container">
    <div class="columns">
        <!-- -->
        <div class="column three-fourths">
            <article class="article-content markdown-body">
                <p>关于zsh和item2的关系可以理解为，zsh就是linux下bash shell的升级版；iterm2是termainal的升级版，可以自定义terminal主题配色；<code>cmd + ,</code>呼出配置。可以新增配置，并将之设置默认，（默认配置前有个⭐）<br><a id="more"></a></p>
<h3 id="zsh的高效命令（常用）"><a href="#zsh的高效命令（常用）" class="headerlink" title="zsh的高效命令（常用）"></a>zsh的高效命令（常用）</h3><ol>
<li><p>zsh 的命令<strong>补全</strong>功能非常强大，可以补齐路径，补齐命令，补齐参数等。你记住 tar 的所有参数了吗 ，只要 tar -加 tab 键</p>
</li>
<li><p>按下 tab 键显示出所有待选项后，再按一次 tab 键，即进入选择模式.进入选择模式后，按 tab 切向下一个选项，按 <code>shift+tab</code> 键切向上一个选项，<code>ctrl+f/b/n/p</code>可以向前后左右切换</p>
</li>
<li><p><code>ps aux | grep xxx</code>查进程的 PID，然后kill PID有了 zsh，直接kill xxx然后按下 tab 键即可</p>
<pre><code>kill emac
# 按下 tab，变成：
kill 59683
</code></pre></li>
<li><p>zsh的历史记录跨 session，可以共享。历史记录支持受限查找。比如，输入git，再按向上箭头，会搜索用过的所有 git 命令</p>
</li>
<li><p>zsh 的目录跳转更为智能，你无需输入cd，直接输入路径即可。<code>..</code>表示后退一级目录，<code>../../</code>表示后退两级，依次类推。（<code>...</code>的作用和<code>../../</code>相同）</p>
</li>
<li><p>输入d回车，将列出当前 session 访问过的所有目录，再输入提示的数字即可进入相应目录。</p>
</li>
</ol>
<h3 id="zsh配置"><a href="#zsh配置" class="headerlink" title="zsh配置"></a>zsh配置</h3><p>位于 ~/.zshrc，可以修改theme,当前使用cloud,可以自定义alias</p>
<h3 id="iterm2的配置"><a href="#iterm2的配置" class="headerlink" title="iterm2的配置"></a>iterm2的配置</h3><p>color配色方案：colors import我们githubs主题即可，更多关于iterm的信息见<a href="https://item2.com。" target="_blank" rel="external">https://item2.com。</a><br>比如选择dracula配色方案<a href="https://github.com/dracula/iterm" target="_blank" rel="external">https://github.com/dracula/iterm</a> </p>
<blockquote>
<p><code>working directory：Reuse previous&#39;directory</code> //directory总是展示当前dirname</p>
</blockquote>

            </article>
            
                <div class="share">
                    <!--开启分享-->
<div class="share-component" data-disabled="google,twitter,facebook" data-description="关于zsh和item2的关系可以理解为，zsh就是li..."></div>

<script src="/js/share.min.js"></script>

                </div>    
            
            
                
<div class="comments">
	<div class="ds-thread" data-thread-key="zsh-and-item2" data-title="Mac下的终端和命令行item2和zsh" data-url="http://upeng.github.io/2016/12/04/zsh-and-item2/"></div>
	<script type="text/javascript">
	var duoshuoQuery = {short_name:"upeng"};
		(function() {
			var ds = document.createElement('script');
			ds.type = 'text/javascript';ds.async = true;
			ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
			ds.charset = 'UTF-8';
			(document.getElementsByTagName('head')[0]
			 || document.getElementsByTagName('body')[0]).appendChild(ds);
		})();
	</script>
</div>

            
        </div>
        <div class="column one-fourth">
            
                
                


<h3>Post Directory</h3>

<div id="post-directory-module">
	<section class="post-directory">
		<p><strong class="toc-title">文章目录</strong></p>
		<ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#zsh的高效命令（常用）"><span class="toc-text">zsh的高效命令（常用）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#zsh配置"><span class="toc-text">zsh配置</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#iterm2的配置"><span class="toc-text">iterm2的配置</span></a></li></ol>
	</section>
</div>
            
        </div>
    </div>
</section>

<footer class="container">
    <div class="site-footer" role="contentinfo">
        <div class="copyright left mobile-block">
                © 2016
                <span title="yupeng">yupeng</span>
                <a href="javascript:window.scrollTo(0,0)" class="right mobile-visible">TOP</a>
        </div>

        <ul class="site-footer-links right mobile-hidden">
            <li>
                <a href="javascript:window.scrollTo(0,0)" >TOP</a>
            </li>
        </ul>

        <a href="https://github.com/upeng" target="_blank" aria-label="view source code">
            <span class="mega-octicon octicon-mark-github" title="GitHub"></span>
        </a>

        <ul class="site-footer-links mobile-hidden">
            
                  
                  <li>
                    <a href="/"  title="Home">Home</a>
                  </li>
            
                  
                  <li>
                    <a href="/categories/"  title="Categories">Categories</a>
                  </li>
            
                  
                  <li>
                    <a href="/bookmark/"  title="Bookmark">Bookmark</a>
                  </li>
            
                  
                  <li>
                    <a href="http://shareup.sinaapp.com"  title="Share">Share</a>
                  </li>
            
                  
                  <li>
                    <a href="/about/"  title="About">About</a>
                  </li>
            
            <li>
                <a href="/atom.xml">
                    <span class="octicon octicon-rss" style="color:orange;"></span>
                </a>
            </li>
        </ul>
    </div>
</footer>


		<script src="/js/geopattern.js"></script>

		
			<script src="/js/toc.js"></script>
		

		<script src="/js/highlight.pack.js"></script>
		<script src="/lib/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

		<script src="/js/index.js"></script>

		 <script src="/js/popular_repo.js"></script> 

	</body>
</html>